Magnetic sensor circuit

ABSTRACT

Provided is a magnetic sensor circuit in which increase of a delay time period is suppressed to be small without reducing a noise suppressing effect, in a case where there are multiple magnetic field detection axes. A magnetic sensor circuit is configured to subject detection signals obtained from multiple magnetic-field detection axes to time division processing, and includes a magnetic detector including at least two magnetic sensors, a switching circuit selecting a magnetic sensor represented by a selection signal to transmit the detection signal, a comparator, a control circuit, and output terminals. The control circuit supplies the selection signal to the switching circuit, and determines that the magnetic field is detected in a case where the number of times that a signal level of the signal supplied from the switching circuit exceeds a reference level reaches the number of set times that is set to a plurality of times.

RELATED APPLICATIONS

This application claims priority to Japanese Patent Application No.2019-025535 filed on Feb. 15, 2019, the entire content of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a magnetic sensor circuit.

2. Description of the Related Art

There has been known a magnetic sensor circuit configured to detect amagnetic field. The magnetic sensor circuit has a detection axis fordetecting the magnetic field, and can detect the magnetic field in adirection along the detection axis. For example, there has been proposeda magnetic sensor circuit capable of detecting magnetic fields in threedirections.

The magnetic sensor circuit described in U.S. Pat. No. 9,664,752 is usedfor the purpose of, for example, detecting a magnetic field to beapplied for tampering from the outside in order to induce malfunction ofa device. The above-mentioned magnetic sensor circuit can detect amagnetic field applied for tampering even if the magnetic field isapplied for tampering from any direction, as long as a magnetic fluxdensity in any one of an x axis, a y axis, and a z axis exceeds apredetermined threshold value.

However, the magnetic sensor circuit described in U.S. Pat. No.9,664,752 has room for further improvement in detection speed at thetime of detecting the magnetic field applied for tampering. Morespecifically, the above-mentioned magnetic sensor circuit is drivenintermittently, and hence there arises a problem in that the detectionspeed is lower as compared to that of a magnetic sensor circuit that isdriven continuously. Further, in order to rapidly detect the magneticfield applied for tampering, it is desired that a time period requireduntil an output logic signal is changed from the time at which themagnetic flux density exceeds the predetermined threshold value(hereinafter referred to as “delay time period”) be reduced as much aspossible.

Now, the delay time period of the related-art magnetic sensor circuit isdescribed. FIG. 4 is an example of timing charts of the related-artmagnetic sensor circuit. In this case, a magnetic flux density Bx, amagnetic flux density By, and a magnetic flux density Bz in FIG. 4represent an x-axis direction component, a y-axis direction component,and a z-axis direction component, respectively, of a magnetic fluxdensity B in an xyz three-dimensional orthogonal coordinate system.Further, in FIG. 4, there is exemplified a case in which a vector of amagnetic flux to be applied is set so that the magnetic flux density Bxand the magnetic flux density By are relatively lower than the magneticflux density to be applied to the z axis, and the detection operation isperformed in the z axis. Further, in FIG. 4, “T” represents a signalprocessing time period per axis. Further, a time t0 in the horizontalaxis (time axis) represents a time at which the magnetic flux density Bzexceeds a z-axis operating point Bopz, and a time t1 represents a timeat which a signal representing an output state of the z axis shifts(from high to low or from low to high).

In the magnetic field detection of the magnetic sensor circuitexemplified in FIG. 4, it is determined that a magnetic field isdetected at a corresponding detection axis if a pulse that appears in awaveform of a signal Sg in a case where the magnetic flux density of thedetection axis exceeds the z-axis operating point Bopz is detectedsuccessively a plurality of times, for example, four times. The changeof the magnetic flux density at the outside is asynchronous with thesignal processing operation performed inside of the magnetic sensorcircuit, and the output logic signal changes with a delay correspondingto the delay time period from the change of the magnetic flux density atthe outside. Therefore, as shown in FIG. 4, in a case where theselection among the x axis, the y axis, and the z axis is sequentiallyrepeated, and four successive matching determinations are required forthe detection of the magnetic field, the maximum time period(hereinafter referred to as “maximum output delay time period”) τrequired until the output logic signal is changed from the time at whichthe magnetic flux density Bz first exceeds the z-axis operating pointBopz, that is, the time period from the time t0 to the time t1, is 12T.This maximum output delay time period τ is remarkably increased as thenumber of detection axes is increased.

In contrast, if the number of times of matching determination requiredfor the detection of the magnetic field is reduced, the increase of themaximum output delay time period can be suppressed, but reduction innumber of times of matching determination leads to reduction in noisesuppressing effect.

SUMMARY OF THE INVENTION

The present invention has been made in view of the above-mentionedcircumstances, and has an object to provide a magnetic sensor circuit inwhich increase of a delay time period is suppressed to be small withoutreducing a noise suppressing effect, in a case where there is aplurality of detection axes (multiple axes) for detecting magneticfields.

In order to achieve the above-mentioned object, a magnetic sensorcircuit according to at least one embodiment of the present inventionhas at least a first detection axis capable of detecting a magneticfield in a first direction and a second detection axis capable ofdetecting a magnetic field in a second direction, and is configured tosubject a first detection signal corresponding to the magnetic field inthe first direction and a second detection signal corresponding to themagnetic field in the second direction to time division processing, themagnetic sensor circuit including a magnetic detector including at leasttwo magnetic sensors including a first magnetic sensor configured tosupply the first detection signal and a second magnetic sensorconfigured to supply the second detection signal; a switching circuit,which is to be connected to each of the at least two magnetic sensors ofthe magnetic detector, and which is configured to supply any onedetection signal among detection signals received from the magneticdetector; a comparator configured to compare a signal level of thereceived one detection signal with a set reference level to supply afirst result signal and a second result signal, the first result signalrepresenting that the signal level of the one detection signal is equalto or lower than the set reference level, the second result signalrepresenting that the signal level of the one detection signal is higherthan the set reference level; a control circuit, which is to beconnected to the comparator, and which is configured to determinewhether the magnetic field is detected based on the first result signaland the second result signal to supply a signal representing adetermination result; and an output terminal to be connected to thecontrol circuit, the control circuit being configured to supply a signalcorresponding to each of the at least two magnetic sensors of themagnetic detector to the switching circuit, and to determine that themagnetic field is detected in a case where a number of times that thesecond result signal is successively received reaches a number of settimes that is set to two or more times, the switching circuit beingconfigured to select a magnetic sensor corresponding to the signalreceived from the control circuit to supply corresponding one of thedetection signals received from the selected magnetic sensor.

In the magnetic sensor circuit, increase of a delay time period issuppressed to be small without reducing a noise suppressing effect, in acase where there are multiple axes for detecting magnetic fields.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram for illustrating a magnetic sensor circuitaccording to an embodiment of the present invention;

FIG. 2 is a block diagram for illustrating a configuration example of acontrol circuit included in the magnetic sensor circuit according to theembodiment;

FIG. 3A is a graph for showing time shift of an x-axis directioncomponent of a magnetic flux density;

FIG. 3B is a graph for showing time shift of a y-axis directioncomponent of the magnetic flux density;

FIG. 3C is a graph for showing time shift of a z-axis directioncomponent of the magnetic flux density;

FIG. 3D is a graph for showing time shift of a sensor selection signalSf;

FIG. 3E is a graph for showing time shift of a comparator output signalSd; and

FIG. 4 is an example of timing charts of the related-art magnetic sensorcircuit.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Now, a magnetic sensor circuit according to at least one embodiment ofthe present invention is described with reference to the accompanyingdrawings.

FIG. 1 is a block diagram for illustrating a magnetic sensor circuit 1as a magnetic sensor circuit according to an embodiment of the presentinvention.

The magnetic sensor circuit 1 is a magnetic sensor circuit, which has atleast two detection axes, specifically, an x axis serving as a firstdetection axis capable of detecting a magnetic field in an x-axisdirection being a first direction and a y axis serving as a seconddetection axis capable of detecting a magnetic field in a y-axisdirection being a second direction, and which is configured to subjectat least a first detection signal corresponding to the magnetic field inthe x-axis direction and a second detection signal corresponding to themagnetic field in the y-axis direction to time division processing. Themagnetic sensor circuit 1 illustrated in FIG. 1 is a magnetic sensorcircuit having three detection axes as an example of the at least twodetection axes. The three detection axes are an x axis, a y axis, and az axis, which are orthogonal to each other.

The magnetic sensor circuit 1 includes, for example, a magnetic detector10, a switching circuit 20, an amplifier 30, a comparator 40, a controlcircuit 50, a first output terminal 51, a second output terminal 52, anda third output terminal 53.

The magnetic detector 10 includes an x-axis magnetic sensor 11configured to detect the magnetic field in the x-axis direction tosupply the first detection signal, a y-axis magnetic sensor 12configured to detect the magnetic field in the y-axis direction tosupply the second detection signal, and a z-axis magnetic sensor 13configured to detect a magnetic field in a z-axis direction being athird direction to supply a third detection signal. Each of the x-axismagnetic sensor 11, the y-axis magnetic sensor 12, and the z-axismagnetic sensor 13 includes an output port for supplying the detectionsignal that is based on the detected magnetic field. The output port ofeach of the x-axis magnetic sensor 11, the y-axis magnetic sensor 12,and the z-axis magnetic sensor 13 is connected to an input port of theswitching circuit 20.

The switching circuit 20 includes a first input port, a second inputport, and a third input port that are connected to the magnetic detector10, more specifically, to the x-axis magnetic sensor 11, the y-axismagnetic sensor 12, and the z-axis magnetic sensor 13, respectively. Theswitching circuit 20 further includes a fourth input port connected to afourth output port of the control circuit 50 to be described later. Theswitching circuit 20 further includes an output port for supplying oneof the detection signals received from the x-axis magnetic sensor 11,the y-axis magnetic sensor 12, and the z-axis magnetic sensor 13. Theoutput port of the switching circuit 20 is connected to an input port ofthe amplifier 30.

The amplifier 30 includes the input port connected to the output port ofthe switching circuit 20, and an output port for supplying a signalobtained by amplifying the signal received from the input port. Theoutput port of the amplifier 30 is connected to an input port of thecomparator 40.

The comparator 40 includes the input port connected to the output portof the amplifier 30, and an output port for supplying a signalrepresenting a result of comparison between a signal level of the signalreceived from the input port and a set reference level. The output portof the comparator 40 is connected to an input port of the controlcircuit 50.

The control circuit 50 includes a first input port at which a referenceclock signal CLK is received, a second input port at which a resetsignal RST is received, and a third input port connected to the outputport of the comparator 40. The control circuit 50 further includes afirst output port, a second output port, and a third output port eachused to supply a signal representing a determination result, which isobtained after determining whether or not a magnetic field is detectedbased on an output signal of the comparator 40. The control circuit 50further includes the fourth output port connected to the fourth inputport of the switching circuit 20. The first output port, the secondoutput port, and the third output port are connected to the first outputterminal 51, the second output terminal 52, and the third outputterminal 53, respectively.

The first output terminal 51, the second output terminal 52, and thethird output terminal 53 are terminals for supplying a first outputsignal, a second output signal, and a third output signal, respectively,to an external circuit (not illustrated). Further, the first outputsignal is a signal representing a result obtained by the control circuit50 determining whether or not the x-axis magnetic sensor 11 is detectingthe magnetic field. The second output signal is a signal representing aresult obtained by the control circuit 50 determining whether or not they-axis magnetic sensor 12 is detecting the magnetic field. The thirdoutput signal is a signal representing a result obtained by the controlcircuit 50 determining whether or not the z-axis magnetic sensor 13 isdetecting the magnetic field.

FIG. 2 is a block diagram for illustrating a configuration example ofthe control circuit 50 in the magnetic sensor circuit 1. The controlcircuit 50 includes, for example, a 2-bit counter AC, a decoder 55, anoutput signal latch circuit OL, a delay circuit 56, an RS flip-flopcircuit RS, a 4-bit shift register SR, AND gates A1 to A7, OR gates OR1and OR2, and a NOT gate 57.

The counter AC includes two D flip-flop circuits AC1 and AC2, and isconfigured by connecting a Q output port of the D flip-flop circuit AC1to a clock input port of the D flip-flop circuit AC2. The output signallatch circuit OL includes three D flip-flop circuits OL1, OL2, and OL3.The shift register SR includes four D flip-flop circuits SR1 to SR4.

A first input port 61 is connected to one of input ports of the AND gateA1, a clock input port of each of the D flip-flop circuits SR1 to SR4,one of input ports of each of the AND gates A3 to A5, and an input portof the delay circuit 56. An output port of the AND gate A1 is connectedto a clock input port of the D flip-flop circuit AC1. A Q-bar outputport of the D flip-flop circuit AC1 is connected to a D input port ofthe D flip-flop circuit AC1, and a Q-bar output port of the D flip-flopcircuit AC2 is connected to a D input port of the D flip-flop circuitAC2. Further, the Q output port of the D flip-flop circuit AC1 isconnected to one input port of the decoder 55, one input port of the ANDgate A2, and the fourth input port of the switching circuit 20. A Qoutput port of the D flip-flop circuit AC2 is connected to another inputport of the decoder 55, another input port of the AND gate A2, and thefourth input port of the switching circuit 20.

Three output ports of the decoder 55 are each connected to one of inputports of each of the AND gates A3 to A5. Further, an output port of theAND gate A2 is connected to one of input ports of the OR gate OR1.Further, an output port of the delay circuit 56 is connected to one ofinput ports of the AND gate A7 via the NOT gate 57.

A second input port 62 is connected to one of input ports of each of theOR gates OR1 and OR2, and a reset input port of each of the D flip-flopcircuits OL1, OL2, and OL3. An output port of the OR gate OR1 isconnected to a reset input port of each of the D flip-flop circuits ACand AC2. Further, an output port of the OR gate OR2 is connected to an Rinput port of an RS flip-flop circuit RS, and a reset input port of eachof the D flip-flop circuits SR1 to SR4.

A third input port 63 is connected to a D input port of the D flip-flopcircuit SR1. A Q output port of the D flip-flop circuit SR1 is connectedto one of four input ports of the AND gate A6, and an S input port ofthe RS flip-flop circuit RS. A Q-bar output port of the RS flip-flopcircuit RS is connected to one of input ports of the AND gate A1.Further, a Q output port of the D flip-flop circuit SR3 and Q-bar outputports of the D flip-flop circuits SR2 and SR4 are connected to theremaining three input ports of the AND gate A6. Q-bar output ports ofthe D flip-flop circuits SR1, SR2, and SR3 are connected to D inputports of the D flip-flop circuits SR2, SR3, and SR4 at the subsequentstage.

An output port of the AND gate A6 is connected to one of input ports ofeach of the AND gates A3, A4, A5, and A7. An output port of the AND gateA3 is connected to a clock input port of the D flip-flop circuit OL1. Anoutput port of the AND gate A4 is connected to a clock input port of theD flip-flop circuit OL2. An output port of the AND gate A5 is connectedto a clock input port of the D flip-flop circuit OL3.

A Q-bar output port of the D flip-flop circuit OL1 is connected to aninput port of the D flip-flop circuit OL1 and the first output terminal51. A Q-bar output port of the D flip-flop circuit OL2 is connected to aD input port of the D flip-flop circuit OL2 and the second outputterminal 52. A Q-bar output port of the D flip-flop circuit OL3 isconnected to a D input port of the D flip-flop circuit OL3 and the thirdoutput terminal 53. Further, an output port of the AND gate A7 isconnected to one of input ports of the OR gate OR2.

Next, the action of the magnetic sensor circuit 1, that is, a magneticdetection method to be performed by the magnetic sensor circuit 1 isdescribed.

FIGS. 3A to 3E are illustrations for illustrating an example of timingcharts of the magnetic sensor circuit 1. In FIG. 3A to FIG. 3E, thehorizontal axis represents a time axis t in common. Further, a magneticflux density Bx, a magnetic flux density By, and a magnetic flux densityBz (vertical axis) in FIG. 3A to FIG. 3C represent an x-axis directioncomponent, a y-axis direction component, and a z-axis directioncomponent, respectively, of a magnetic flux density B in an xyzthree-dimensional orthogonal coordinate system.

In FIG. 3A to FIG. 3C, there is exemplified a case in which a vector ofa magnetic flux to be applied is set so that the magnetic flux densityBx and the magnetic flux density By are relatively lower than themagnetic flux density to be applied to the z axis, and the detectionoperation is performed in the z axis.

In FIG. 3D, the vertical axis represents an output value (relativevalue) of a sensor selection signal Sf to be supplied from the controlcircuit 50 to the switching circuit 20. In FIG. 3D, the “x”, the “y”,and the “z” or “z axis” correspond to the contents of the sensorselection signal Sf, and represent the x-axis magnetic sensor 11, they-axis magnetic sensor 12, and the z-axis magnetic sensor 13,respectively.

In FIG. 3E, the vertical axis represents an output value (relativevalue) of a signal (hereinafter referred to as “comparator outputsignal”) Sd to be supplied from the comparator 40. Further, in FIGS. 3Dand 3E, “T” represents a signal processing time period per axis.Further, a time t0 in the horizontal axis (time axis) shown in FIG. 3Ato FIG. 3E represents a time at which the magnetic flux density Bz shownin FIG. 3C exceeds a z-axis operating point Bopz, and a time t1represents a time at which a signal representing an output state of thez axis shifts (from high to low or from low to high).

In the magnetic sensor circuit 1, first, the x-axis magnetic sensor 11,the y-axis magnetic sensor 12, and the z-axis magnetic sensor 13 detectmagnetic fields to supply detection signals that are based on thedetected magnetic fields to the switching circuit 20. The switchingcircuit 20 selects the magnetic sensor represented by the sensorselection signal Sf, and supplies the detection signal received from theselected magnetic sensor.

The sensor selection signal Sf includes a 2-bit signal. For example, ina case where the sensor selection signal Sf includes a 2-bit signal(00b), the switching circuit 20 selects the x-axis magnetic sensor 11,and supplies the detection signal received from the x-axis magneticsensor 11 to the amplifier 30. Further, in a case where the sensorselection signal Sf includes a 2-bit signal (01b), the switching circuit20 selects the y-axis magnetic sensor 12, and supplies the detectionsignal received from the y-axis magnetic sensor 12 to the amplifier 30.Further, in a case where the sensor selection signal Sf includes a 2-bitsignal (10b), the switching circuit 20 selects the z-axis magneticsensor 13, and supplies the detection signal received from the z-axismagnetic sensor 13 to the amplifier 30.

The amplifier 30 amplifies the detection signal received from theswitching circuit 20, and then supplies the amplified detection signalto the comparator 40. The comparator 40 compares a signal level of thedetection signal received from the switching circuit 20 via theamplifier 30 with a set reference level, and supplies a low (L) levelsignal or a high (H) level signal representing a result of thecomparison to the control circuit 50.

In this case, the L level signal is, for example, a signal (hereinafterreferred to as “first result signal”) representing such a first resultthat the signal level of the received detection signal is equal to orlower than the set reference level, that is, the signal level of thereceived detection signal does not exceed the set reference level.Further, the H level signal is a signal (hereinafter referred to as“second result signal”) representing such a second result that thesignal level of the received detection signal exceeds the set referencelevel. The H level signal is represented as a pulse in FIG. 3E.

A case in which the comparator output signal Sd is the first resultsignal means that the magnetic flux density detected by the selectedmagnetic sensor is below a release point. A case in which the comparatoroutput signal Sd is the second result signal means that theabove-mentioned magnetic flux density exceeds the operating point.

The control circuit 50 supplies the sensor selection signal Sf to theswitching circuit 20 based on the comparator output signal Sd. Further,the control circuit 50 supplies the first output signal to the firstoutput terminal 51, supplies the second output signal to the secondoutput terminal 52, and supplies the third output signal to the thirdoutput terminal 53.

In a case where the comparator output signal Sd is the first resultsignal, selection of the x axis, the y axis, and the z axis is repeatedin the set order. More specifically, the control circuit 50 supplies, tothe switching circuit 20, the sensor selection signal Sf including the2-bit signal (00b), (01b), or (10b) representing which detection axisamong the x axis, the y axis, and the z axis is to be selected.

Further, in a case where the comparator output signal Sd is the secondresult signal, the control circuit 50 selects any currently-selecteddetection axis among the x axis, the y axis, and the z axis successivelya predetermined number of set times. For example, in a case where themagnetic detection sensor supplying the detection signal is the z-axismagnetic sensor 13, the control circuit 50 supplies, to the switchingcircuit 20, the sensor selection signal Sf including the 2-bit signal(10b) representing that the detection axis corresponding to the z axisis selected. The above-mentioned predetermined number of set timescorresponds to the number of times to perform matching determination,and is set to two or more times, for example, four times.

As shown in FIG. 3C, the magnetic flux density Bz exceeds the z-axisoperating point Bopz at the time t0, but as shown in FIG. 3D, the timet0 is a time point at which the period in which the control circuit 50is selecting the z axis is ended. Therefore, as shown in FIG. 3E, at thetime t0, the comparator output signal Sd is brought to the L level.Thus, in the next z-axis selecting period, the comparator output signalSd is shifted to be brought to the H level. That is, the control circuit50 determines that matching is made once. After this z-axis selectingperiod, the detection axis corresponding to the z axis is furthersuccessively selected three times. At the time t1, the matchingdetermination is successively made four times, and hence the controlcircuit 50 supplies, to the third output terminal 53, an output signal(for example, L level) representing that the z-axis magnetic sensor 13is detecting a magnetic field in the z-axis direction.

According to the magnetic sensor circuit 1 and the magnetic detectionmethod therefor, in a case where the magnetic flux density Bz exceedsthe z-axis operating point Bopz, the z axis is repeatedly selected apredetermined number of times so that matching determination is made apredetermined number of times. With the above-mentioned operation, in acase where there are three detection axes and the matching determinationis made four times, a time period (maximum output delay time period)from the time t0 to the time t1 can be suppressed to 6T. This is half ofthe maximum output delay time period 12T required in a case of applyinga magnetic sensor circuit, which is configured to sequentially selectthe x axis, the y axis, and the z axis in FIG. 4, and a magneticdetection method therefor.

As described above, according to this embodiment, even if the matchingdetermination is made a plurality of times, the increase of the delaytime period can be suppressed to be small without reducing the noisesuppressing effect. That is, according to the magnetic sensor circuit 1and the magnetic detection method therefor, it is possible to provide amulti-axis magnetic sensor circuit, which has sufficient repeatabilityand reproducibility of the operating point and the release point withoutsignificantly decreasing the responsiveness, and to provide a magneticdetection method therefor.

It is noted that the present invention is not limited to theabove-described at least one embodiment as they are and, in animplementation phase, can be embodied in various forms other than thespecific embodiments described above. Various omissions, additions,substitutions, and changes may be made without departing from the spiritand scope of the invention. The at least one embodiment andmodifications thereof are included within the sprit and scope of theinvention and are included within the scope of the invention asdisclosed in the claims and equivalents thereof.

For example, the above-mentioned magnetic sensor circuit 1 is an examplehaving three detection axes, but the number of detection axes is notnecessarily limited to three. The present invention is applicable to amagnetic sensor circuit having at least two detection axes. That is, thepresent invention is applicable to a two-axis magnetic sensor circuitsuch as a two-axis switch or a two-axis latch. Further, theconfiguration of the control circuit 50 is not limited to thatexemplified in FIG. 2, and other configurations may be employed as longas the configurations are functionally equivalent.

Further, components may be added to the magnetic sensor circuit 1 asrequired. For example, in consideration of a case in which an S/N ratioof the amplified detection signal is low, a filter circuit may be addedbetween the amplifier 30 and the comparator 40. Further, the magneticsensor circuit 1 illustrated in FIG. 1 is an example in which the samenumber of output terminals 51, 52, and 53 as the number of detectionaxes are provided, but the configuration of the output terminals is notnecessarily limited thereto. In a case where the control circuit 50 isconfigured so that the control circuit 50 adds information that enablesany of the x axis, the y axis, and the z axis to be identified to asignal to be supplied to the outside, the number of output terminals maybe one.

Further, in a case where sensor elements having large offset voltages,for example, Hall elements are used for the x-axis magnetic sensor 11,the y-axis magnetic sensor 12, and the z-axis magnetic sensor 13,further components may be added to the magnetic sensor circuit 1 so thata spinning current method can be applied. For example, a switch networkis provided between the switching circuit 20 and each of the x-axismagnetic sensor 11, the y-axis magnetic sensor 12, and the z-axismagnetic sensor 13, or between the switching circuit 20 and theamplifier 30. Further, a sample and hold circuit is provided between theamplifier 30 and the comparator 40. Further, timings such as φ1 and φ2are set during the processing period T of each of the detection axescorresponding to the x axis, the y axis, and the z axis.

According to the magnetic sensor circuit having a configuration thatenables the spinning current method to be applied as described above andto a magnetic detection method therefor, the offset voltage can becanceled even if a sensor element having a large offset voltage is used.

The magnetic sensor circuit 1 illustrated in FIG. 1 is an exampleincluding the amplifier 30, but in a case where the detection signals ofthe magnetic sensors 11, 12, and 13 to be supplied from the switchingcircuit 20 have sufficiently high S/N ratios, the amplifier 30 may beomitted. Further, the magnetic sensor circuit 1 may be configured as asemiconductor device. That is, the magnetic sensor circuit 1 may beformed on a semiconductor substrate. The semiconductor device mayinclude a part of components of the magnetic sensor circuit 1. Thesemiconductor device composed of the control circuit 50 may beconfigured as a magnetic detection controller.

What is claimed is:
 1. A magnetic sensor circuit, which has at least a first detection axis capable of detecting a magnetic field in a first direction and a second detection axis capable of detecting a magnetic field in a second direction, and which is configured to subject a first detection signal corresponding to the magnetic field in the first direction and a second detection signal corresponding to the magnetic field in the second direction to time division processing, the magnetic sensor circuit comprising: a magnetic detector including at least two magnetic sensors including a first magnetic sensor configured to supply the first detection signal and a second magnetic sensor configured to supply the second detection signal; a switching circuit, which is to be connected to each of the at least two magnetic sensors of the magnetic detector, and which is configured to supply any one detection signal among detection signals received from the magnetic detector; a comparator configured to compare a signal level of the received one detection signal with a set reference level to supply a first result signal and a second result signal, the first result signal representing that the signal level of the one detection signal is equal to or lower than the set reference level, the second result signal representing that the signal level of the one detection signal is higher than the set reference level; and a control circuit, which includes an input port connected to the comparator and a control signal output port connected to the switching circuit, and which is configured to determine whether the magnetic field is detected based on the first result signal, the second result signal, and a number of times that the second result signal is successively received, and to supply a control signal corresponding to each of the at least two magnetic sensors of the magnetic detector to the switching circuit based on a determination whether the magnetic field is detected, the switching circuit being configured to select a magnetic sensor corresponding to the control signal received from the control circuit to supply corresponding one of the detection signals received from the selected magnetic sensor, the switching circuit including a control signal input port connected to the control signal output port in the control circuit.
 2. The magnetic sensor circuit according to claim 1, further comprising an amplifier configured to amplify the one detection signal, wherein the amplifier is to be connected between the switching circuit and the comparator.
 3. The magnetic sensor circuit according to claim 1, wherein the control circuit includes an output circuit which is configured to generate an output signal corresponding to each of the at least two magnetic sensors of the magnetic detector in a case where the control circuit determines that the magnetic field is detected.
 4. The magnetic sensor circuit according to claim 3, further comprising output terminals, wherein the output circuit includes output ports which are to be connected to each of the output terminals, and of which a number is a same number as a number of the at least two magnetic sensors.
 5. The magnetic sensor circuit according to claim 1, wherein the control circuit includes a counter which is configured to count the number of times that the second result signal is successively received, a determination circuit which is configured to determine whether or not the number of times that the second result signal is successively received reaches a number of set times that is set to two or more times based on a number counted by the counter, and a control signal generation circuit which is configured to generate the control signal based on a result determined by the determination circuit.
 6. The magnetic sensor circuit according to claim 5, wherein the control signal generation circuit has a first generation pattern of the control signal and a second generation pattern of the control signal, and is configured to perform the first generation pattern to generate the control signal if the determination circuit determines that the number of times that the second result signal is successively received reaches the number of set times that is set to two or more times or the number of times that the second result signal is successively received is zero, and to perform the second generation pattern to generate the control signal if the determination circuit determines that the number of times that the second result signal is successively received is larger than zero but less than the number of set times that is set to two or more times.
 7. The magnetic sensor circuit according to claim 6, wherein the control signal generated by currently performing the second generation pattern corresponds to any one magnetic sensor of the at least two magnetic sensors, the any one magnetic sensor being a same one magnetic sensor as corresponding one magnetic sensor of the control signal generated by previously performing the second generation pattern.
 8. The magnetic sensor circuit according to claim 1, the magnetic sensor circuit being configured to subject a third detection signal in addition to the first and second detection signal to time division processing, wherein the magnetic detector includes a third magnetic sensor configured to supply the third detection signal corresponding to a magnetic field in a third direction being perpendicular to the first direction and the second direction, and wherein the switching circuit includes a first input port to be connected to the first magnetic sensor, a second input port to be connected to the second magnetic sensor, a third input port to be connected to the third magnetic sensor, the control signal input port, and an output port configured to selectively connect to any one input port of the first to third input ports. 